//
//  IndexShopNavCell.m
//  YunFu
//
//  Created by Bager on 2018/8/31.
//  Copyright © 2018年 yunfu. All rights reserved.
//

#import "IndexShopNavCell.h"

@implementation IndexShopNavCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        [self setViews];
    }
    return self;
}

- (void)setViews
{
    [self addSubview:self.img];
    [self addSubview:self.name];
    [self addSubview:self.type];
    [self addSubview:self.detail];
}

- (UIImageView *)img
{
    if (!_img)
    {
        _img = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 80, 80)];
        _img.contentMode = UIViewContentModeCenter;
        _img.layer.masksToBounds = YES;
    }
    return _img;
}

- (UILabel *)name
{
    if (!_name)
    {
        _name = [[UILabel alloc] initWithFrame:CGRectMake(80, 20, (kScreenWidth - kPublicMargin * 2 - 30) / 2.0 - 90, 20)];
        _name.adjustsFontSizeToFitWidth = YES;
        _name.font = [UIFont systemFontOfSize:12];
        _name.textAlignment = NSTextAlignmentRight;
        _name.textColor = [UIColor grayColor];
    }
    return _name;
}

- (UILabel *)detail
{
    if (!_detail)
    {
        _detail = [[UILabel alloc] initWithFrame:CGRectMake(80, 40, (kScreenWidth - kPublicMargin * 2 - 30) / 2.0 - 90, 20)];
        _detail.adjustsFontSizeToFitWidth = YES;
        _detail.font = [UIFont systemFontOfSize:10];
        _detail.textAlignment = NSTextAlignmentRight;
        _detail.textColor = [UIColor grayColor];
    }
    return _detail;
}


- (UILabel *)type
{
    if (!_type)
    {
        _type = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 18)];
        _type.adjustsFontSizeToFitWidth = YES;
        _type.font = [UIFont systemFontOfSize:10];
        _type.backgroundColor = [UIColor redColor];
        _type.textColor = [UIColor whiteColor];
        _type.textAlignment = NSTextAlignmentCenter;
    }
    return _type;
}

@end
